/**
 * @Title: ThreadPoolManger.java
 * @Package com.starlight.smscheckin.util
 * @Description: TODO
 * Copyright: Copyright (c) 2011 
 * Company:辰运科技技术有限责任公司
 * @author xiaoming.yuan 
 * @date 2013-5-29 上午9:04:36
 * @version V1.0
 */
package com.mobilezu.mobile.android.mobile4s.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @ClassName: ThreadPoolManger
 * @Description: TODO
 * @author xiaoming.yuan
 * @date 2013-5-29 上午9:04:36
 */
public class ThreadPoolManager {
  private ExecutorService service;

  private ThreadPoolManager() {
    int num = Runtime.getRuntime().availableProcessors();
    service = Executors.newFixedThreadPool(num * 2);

  }

  private static final ThreadPoolManager manager = new ThreadPoolManager();

  public static ThreadPoolManager getInstance() {

    return manager;

  }

  public void addTask(Runnable runnable) {

    service.execute(runnable);

  }

}
